/*
 * PyKineticSolver.cpp
 *
 *  Created on: 13 Mar 2012
 *      Author: allan
 */

#include "PyKineticSolver.h"

// GeoReact includes
#include <GeoReact.h>

// Boost includes
#include <boost/python.hpp>
using namespace boost::python;

const dict
Step(const KineticSolver& kinetic_solver,
	double t, double t1, double dt, double T, double P, VectorXd& n)
{
	kinetic_solver.Step(t, t1, dt, T, P, n);
	
	dict res; res["t"] = t; res["dt"] = dt; return res;
}

void export_KineticSolver()
{
	void (KineticSolver::*SetParametersOdeSolver)(const OdeSolverParams&) = 
		&KineticSolver::SetParameters;
	
	void (KineticSolver::*SetParametersEquilibriumSolver)(const EquilibriumSolverParams&) = 
		&KineticSolver::SetParameters;
	
	class_<KineticSolver>("KineticSolver")
		.def(init<>())
		
		.def(init<const KineticSolver&>())
		
		.def(init<const KineticSystem&>())
		
		.def("SetParameters",
			SetParametersOdeSolver)
		
		.def("SetParameters",
			SetParametersEquilibriumSolver)
		
		.def("Step",
			Step)
		
		.def("Solve",
			&KineticSolver::Solve);
}
